﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

using System.ComponentModel.Composition;
using Seesmic.Sdp.Extensibility;
using Seesmic.Sdp.Utils;


namespace Seesmic.HelloTipi
{
    public class HelloTipiAccount : ObservableObject, IAccount
    {
        private string _id;
        private string _Name;
        private string _Password;
        private string _screenName;
        private string _urlAvatar;
        private int _userID;
        //private string _Token;

        public override string ToString()
        {
            return string.Format("Id : {0}, UserID : {1}, Username : {2}, Password : {3}, Screename : {4}, Avatar s: {5}", this.Id, this.UserID, this.Username, this.Password, this.ScreenName, this.UrlAvatar);
        }

        public HelloTipiAccount()
        {
            this.Id = Guid.NewGuid().ToString();
            //HelloTipiPlugin.LogInfo("Account, Constructeur : " + this.ToString());
        }

        #region IAccount Members

        public Guid AccountProviderId
        {
            get { return HelloTipiAccountProvider.HelloTipiAccountProviderId; }
        }

        public void UpdateAccount(IAccount sourceAccount)
        {

        }

        public string Id
        {
            get { return this._id; }
            set { this._id = value; }
        }

        public string Username
        {
            get
            {
                return this._Name;
            }
            set
            {
                if (value != this._Name)
                {
                    this._Name = value;
                    this.OnPropertyChanged("Username");
                }
            }
        }

        #endregion

        public string Password
        {
            get
            {
                return this._Password;
            }
            set
            {
                if (value != this._Password)
                {
                    this._Password = value;
                    this.OnPropertyChanged("Password");
                }
            }
        }

        public string ScreenName
        {
            get
            {
                return this._screenName;
            }
            set
            {
                if (value != this._screenName)
                {
                    this._screenName = value;
                    this.OnPropertyChanged("ScreenName");
                }
            }
        }

        public string UrlAvatar
        {
            get
            {
                return this._urlAvatar;
            }
            set
            {
                if (value != this._urlAvatar)
                {
                    this._urlAvatar = value;
                    this.OnPropertyChanged("UrlAvatar");
                }
            }
        }

        public int UserID
        {
            get
            {
                return this._userID;
            }
            set
            {
                if (value != this._userID)
                {
                    this._userID = value;
                    this.OnPropertyChanged("UserID");
                }
            }
        }

        /*public string Token
        {
            get
            {
                return this._Token;
            }
            set
            {
                this._Token = value;
            }
        }*/

    }
}
